package com.album.activity;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.album.R;

public class MessageDialog {
	public static void showToast(Context context, boolean isError, String paramString) {
		Toast toast =null;
		if (toast == null)
			toast = new Toast(context);
		View localView = LayoutInflater.from(context).inflate(R.layout.toast, null);;
		((TextView) localView.findViewById(R.id.message)).setText(paramString);
		if (isError) {
			((ImageView) localView.findViewById(R.id.toast_icon)).setImageResource(R.drawable.toast_ok_icon);
		}else{
			((ImageView) localView.findViewById(R.id.toast_icon)).setImageResource(R.drawable.toast_error_icon);
		}
		toast.setView(localView);
		toast.setDuration(0);
		toast.show();
	}
}
